<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/doctrine/BaseFormFilterDoctrine.class.php');

/**
 * Docente filter form base class.
 *
 * @package    filters
 * @subpackage Docente *
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 11675 2008-09-19 15:21:38Z fabien $
 */
class BaseDocenteFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'nm_docente'              => new sfWidgetFormFilterInput(),
      'nu_ordem'                => new sfWidgetFormFilterInput(),
      'nu_matricula'            => new sfWidgetFormFilterInput(),
      'nm_mae'                  => new sfWidgetFormFilterInput(),
      'nm_pai'                  => new sfWidgetFormFilterInput(),
      'nm_conjuge'              => new sfWidgetFormFilterInput(),
      'dt_nascimento'           => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'sg_nacionalidade'        => new sfWidgetFormFilterInput(),
      'sg_estado_civil'         => new sfWidgetFormChoice(array('choices' => array('' => '', 'S' => 'S', 'C' => 'C', 'D' => 'D', 'V' => 'V'))),
      'nm_cidade_nascimento'    => new sfWidgetFormFilterInput(),
      'sg_uf_nascimento'        => new sfWidgetFormFilterInput(),
      'nu_ci'                   => new sfWidgetFormFilterInput(),
      'ds_ci_orgao_emissor'     => new sfWidgetFormFilterInput(),
      'sg_ci_uf'                => new sfWidgetFormFilterInput(),
      'nu_ctps'                 => new sfWidgetFormFilterInput(),
      'nu_ctps_serie'           => new sfWidgetFormFilterInput(),
      'nu_reservista'           => new sfWidgetFormFilterInput(),
      'nu_reservista_categoria' => new sfWidgetFormFilterInput(),
      'nu_cpf'                  => new sfWidgetFormFilterInput(),
      'ds_endereco'             => new sfWidgetFormFilterInput(),
      'sg_endereco_uf'          => new sfWidgetFormFilterInput(),
      'nu_endereco_cep'         => new sfWidgetFormFilterInput(),
      'dt_admissao'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'dt_demissao'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'ds_cargo'                => new sfWidgetFormFilterInput(),
      'nu_salario'              => new sfWidgetFormFilterInput(),
      'ds_forma_pagamento'      => new sfWidgetFormFilterInput(),
      'nu_pis'                  => new sfWidgetFormFilterInput(),
      'dt_pis_cadastro'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'hr_entrada'              => new sfWidgetFormFilterInput(),
      'hr_saida'                => new sfWidgetFormFilterInput(),
      'st_docente'              => new sfWidgetFormFilterInput(),
      'created_at'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'updated_at'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'deleted'                 => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
    ));

    $this->setValidators(array(
      'nm_docente'              => new sfValidatorPass(array('required' => false)),
      'nu_ordem'                => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'nu_matricula'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'nm_mae'                  => new sfValidatorPass(array('required' => false)),
      'nm_pai'                  => new sfValidatorPass(array('required' => false)),
      'nm_conjuge'              => new sfValidatorPass(array('required' => false)),
      'dt_nascimento'           => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'sg_nacionalidade'        => new sfValidatorPass(array('required' => false)),
      'sg_estado_civil'         => new sfValidatorChoice(array('required' => false, 'choices' => array('S' => 'S', 'C' => 'C', 'D' => 'D', 'V' => 'V'))),
      'nm_cidade_nascimento'    => new sfValidatorPass(array('required' => false)),
      'sg_uf_nascimento'        => new sfValidatorPass(array('required' => false)),
      'nu_ci'                   => new sfValidatorPass(array('required' => false)),
      'ds_ci_orgao_emissor'     => new sfValidatorPass(array('required' => false)),
      'sg_ci_uf'                => new sfValidatorPass(array('required' => false)),
      'nu_ctps'                 => new sfValidatorPass(array('required' => false)),
      'nu_ctps_serie'           => new sfValidatorPass(array('required' => false)),
      'nu_reservista'           => new sfValidatorPass(array('required' => false)),
      'nu_reservista_categoria' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'nu_cpf'                  => new sfValidatorPass(array('required' => false)),
      'ds_endereco'             => new sfValidatorPass(array('required' => false)),
      'sg_endereco_uf'          => new sfValidatorPass(array('required' => false)),
      'nu_endereco_cep'         => new sfValidatorPass(array('required' => false)),
      'dt_admissao'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'dt_demissao'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'ds_cargo'                => new sfValidatorPass(array('required' => false)),
      'nu_salario'              => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'ds_forma_pagamento'      => new sfValidatorPass(array('required' => false)),
      'nu_pis'                  => new sfValidatorPass(array('required' => false)),
      'dt_pis_cadastro'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'hr_entrada'              => new sfValidatorPass(array('required' => false)),
      'hr_saida'                => new sfValidatorPass(array('required' => false)),
      'st_docente'              => new sfValidatorPass(array('required' => false)),
      'created_at'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'updated_at'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'deleted'                 => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
    ));

    $this->widgetSchema->setNameFormat('docente_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Docente';
  }

  public function getFields()
  {
    return array(
      'id_docente'              => 'Number',
      'nm_docente'              => 'Text',
      'nu_ordem'                => 'Number',
      'nu_matricula'            => 'Number',
      'nm_mae'                  => 'Text',
      'nm_pai'                  => 'Text',
      'nm_conjuge'              => 'Text',
      'dt_nascimento'           => 'Date',
      'sg_nacionalidade'        => 'Text',
      'sg_estado_civil'         => 'Enum',
      'nm_cidade_nascimento'    => 'Text',
      'sg_uf_nascimento'        => 'Text',
      'nu_ci'                   => 'Text',
      'ds_ci_orgao_emissor'     => 'Text',
      'sg_ci_uf'                => 'Text',
      'nu_ctps'                 => 'Text',
      'nu_ctps_serie'           => 'Text',
      'nu_reservista'           => 'Text',
      'nu_reservista_categoria' => 'Number',
      'nu_cpf'                  => 'Text',
      'ds_endereco'             => 'Text',
      'sg_endereco_uf'          => 'Text',
      'nu_endereco_cep'         => 'Text',
      'dt_admissao'             => 'Date',
      'dt_demissao'             => 'Date',
      'ds_cargo'                => 'Text',
      'nu_salario'              => 'Number',
      'ds_forma_pagamento'      => 'Text',
      'nu_pis'                  => 'Text',
      'dt_pis_cadastro'         => 'Date',
      'hr_entrada'              => 'Text',
      'hr_saida'                => 'Text',
      'st_docente'              => 'Text',
      'created_at'              => 'Date',
      'updated_at'              => 'Date',
      'deleted'                 => 'Boolean',
    );
  }
}